Skip to content

Add timeout for write_serial_console_log function. - #387

Merged
Zhidong Peng (ZhidongPeng) merged 3 commits into
Azure:devfrom
ZhidongPeng:dev
Aug 26, 2026
Merged

Add timeout for write_serial_console_log function.#387
Zhidong Peng (ZhidongPeng) merged 3 commits into
Azure:devfrom
ZhidongPeng:dev

Conversation

@ZhidongPeng

@ZhidongPeng Zhidong Peng (ZhidongPeng) commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

In some Linux VM, our GPA VMExtension detects the GPA status are stale and our log from syslog indicates our GPA service may hang at write_serial_console_log.

Jul 30 19:53:11 4ld30d3vm azure-proxy-agent[1725592]: The log folder is not set, skip write to GPA managed file log.
Jul 30 19:53:12 4ld30d3vm azure-proxy-agent[1725592]: ============== GuestProxyAgent (1.0.48) is starting on Linux:Ubuntu-22.4.0(x86_64), elapsed: 498

Side changes to have reliable CI action results, pin the rust version for linux_lint and windows_lint. We will upgrade the rust version in a separate PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens Linux startup/provision logging by making write_serial_console_log non-blocking with a bounded timeout to prevent hangs observed on some Linux VMs, and updates call sites accordingly. It also attempts to make CI results more reliable by pinning Rust for lint jobs and making cargo-audit installs deterministic.

Changes:

  • Add a non-blocking serial console write helper with a 2s timeout and unit tests (proxy_agent/src/common/logger.rs).
  • Update Linux-only call sites to the new write_serial_console_log(message, path_override) signature (service.rs, provision.rs, helpers.rs).
  • Update CI lint jobs to use a pinned Rust toolchain and cargo install --locked for cargo-audit (.github/workflows/ci.yml).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
proxy_agent/src/service.rs Updates Linux startup serial-console logging call to new signature.
proxy_agent/src/provision.rs Updates provision-state serial-console logging calls to new signature.
proxy_agent/src/common/logger.rs Implements non-blocking /dev/console writes with timeout + adds unit tests.
proxy_agent/src/common/helpers.rs Updates startup event logging call to new signature.
.github/workflows/ci.yml Attempts to pin Rust for lint jobs and adds --locked for cargo-audit installation.
Suppressed comments (1)

.github/workflows/ci.yml:44

  • Same as linux_lint: dtolnay/rust-toolchain@1.95.0 is an action ref and does not pin the Rust compiler version. Use the action’s toolchain input to pin Rust, and keep the action itself on a stable tag (or SHA).
      - uses: dtolnay/rust-toolchain@1.95.0
        with:
          components: rustfmt clippy

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml
Comment thread proxy_agent/src/common/logger.rs
@ZhidongPeng
Zhidong Peng (ZhidongPeng) merged commit 4c7adb9 into Azure:dev Aug 26, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants